#include "friend.h"
#include <QPushButton>
#include <QLabel>
#include "interface_control.h"

Friend::Friend(QWidget *parent, QString frid,QString frname,int id) : QWidget(parent)
{
    this->resize(790,100);
    //初始化成员
    fr.friendloginid = frid;
    fr.FriendGroups = id;
    fr.name = frname;

    QPushButton *touxiang = new QPushButton(this);
    touxiang->setGeometry(0,0,200,100);
    touxiang->setText("头像");

    QLabel *fri_k = new QLabel(this);
    fri_k->setGeometry(300,0,200,100);
    fri_k->setText(frname);

    QPushButton *talk = new QPushButton(this);
    talk->setGeometry(600,0,100,100);
    talk->setText("发起聊天");
    connect(talk,&QPushButton::clicked,[&]()
    {
       //点击打开对应聊天界面
//        Interface_Control::getControlptr()->geto_map(fr.friendloginid)->recvMessage(fr.name);//页面测试
        Interface_Control::getControlptr()->geto_map(fr.friendloginid)->show();

    });
}


